<!DOCTYPE html>
<html class="root61"><head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache,must-revalidate">
    <meta name="_token" content="{{ csrf_token() }}"/>
    <Link Rel="SHORTCUT ICON" href="http://www.jd.com/favicon.ico">
    <title> {{$title}}</title>
    <link type="text/css" rel="stylesheet" href="{{asset('/home/css/a_002.css')}}">
    <link type="text/css" rel="stylesheet" href="{{asset('/home/css/a.css')}}">
    <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.js"></script>
    <script type="text/javascript" src="./js/a_002.js"></script>
    <style>
        .error{border:1px solid red}
        .succ{border:1px solid green}
    </style>
</head>
<body>
<div class="header">
    <div class="logo-con w clearfix">
        <a href="/" class="logo">
        </a>
        <div class="logo-title">欢 迎 注 册</div>
        <div class="have-account">已有账号 <a href="/login">请登录</a></div>
    </div>

</div>
<div class="container w">

    <div class="main clearfix">
        <div class="reg-form fl">
            <form novalidate="novalidate" action="/home/reg/insert" id="register-form" method="post">
                {{ csrf_field() }}
                @foreach ($errors->all() as $error)
                    <span id="name">{{ $error }}</span>
                @endforeach
                <div class="form-item form-item-account" id="form-item-account">
                    <label>用　户　名</label>
                    <input id="form-account" name="username" class="field" autocomplete="off" maxlength="20" placeholder="" type="text" value="{{old('username')}}">
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img id="img" style="right: 30px;width: 24px;">
                    <i class="i-status"></i>
                </div>
                <div class="input-tip">
                    <span id="name">&nbsp;&nbsp;&nbsp;&nbsp;请输入6-12位的用户名</span>
                    <i class="i-error"></i>
                </div>
                <div class="form-item" id="form-pass">
                    <label>设 置 密 码</label>
                    <input name="password" id="form-pwd" class="field" maxlength="20" placeholder="" type="password" value="">
                    <img id="img1" style="right: 30px;width: 24px;">
                    <i class="i-status"></i>
                </div>
                <div class="input-tip">
                    <span id="pass">&nbsp;&nbsp;&nbsp;&nbsp;请输入6-12位的密码</span>
                </div>
                <div class="form-item" id="form-repass">
                    <label>确 认 密 码</label>
                    <input name="repassword" id="form-equalTopwd" class="field" placeholder="" maxlength="20" type="password" value="">
                    <img id="img2" style="right: 30px;width: 24px;">
                    <i class="i-status"></i>
                </div>
                <div class="input-tip">
                    <span id="repass"></span>
                </div>
                <div class="form-item" id="form-email">
                    <label>邮 箱</label>
                    <input name="email" id="" class="field" placeholder="" maxlength="" type="text" value="">
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img id="img3" style="right: 30px;width: 24px;">
                    <i class="i-status"></i>
                </div>
                <div class="input-tip">
                    <span id="email"></span>
                </div>
                <div class="item-phone-wrap">
                    <div class="form-item form-item-phone">
                        <label class="select-country" id="select-country" country_id="0086">中国 + 86<a href="javascript:void(0)" class="arrow"></a></label>
                        <input id="form-phone" name="phone" class="field" placeholder=" " autocomplete="off" maxlength="11" type="text">
                        <i class="i-status"></i>
                    </div>
                    <div class="input-tip">
                        <span></span>
                    </div>

                </div>
                <div class="form-item form-item-authcode">
                    <label>验　证　码</label>
                    <input autocomplete="off" name="" id="authCode" maxlength="6" class="field form-authcode" placeholder="" type="text"><a onclick="javascript:re_captcha();" ><img src="{{ URL('createcode/1') }}"  alt="验证码" title="刷新图片" width="100" height="40" id="c2c98f0de5a04167a9e427d883690ff6" border="0"></a>

                    <script>
                        function re_captcha() {
                            $url = "{{ URL('createcode') }}";
                            $url = $url + "/" + Math.random();
                            document.getElementById('c2c98f0de5a04167a9e427d883690ff6').src=$url;
                        }
                    </script>
                </div>
                <div class="input-tip">
                    <span>
                        @if(session('error'))
                            <div class="msg-error" style="color:red;"><b></b>{{ session('error') }}</div>
                        @endif
                    </span>
                </div>
                <div class="input-tip">
                    <span></span>
                </div>
                <div class="form-agreen">
                    <div><input name="" checked="checked" type="checkbox">我已阅读并同意<a href="javascript:;" id="protocol">《京东用户注册协议》</a> </div>
                    <div class="input-tip">
                        <span></span>
                    </div>
                </div>
                <div>
                    <button type="submit" class="btn-register">立即注册</button>
                </div>
            </form>
        </div>
        <script type='text/javascript'>
            $("input[name='username']").on('blur',function(){
                if($(this).val() == ''){
                    $('#name').css('color', '#c5c5c5').html('请输入6-12位的用户名');
                    $('.form-item-account').removeClass('error');
                    $('.form-item-account').removeClass('succ');
                    $('#img').hide();
                    return false;
                }
                $.ajaxSetup({
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    }
                });
                $.get('/home/reg/ajax',{'username':$("input[name='username']").val()},function(data){
                    $('.form-item-account').removeClass('error');
                    $('.form-item-account').removeClass('succ');
                    $('#img').hide();
                        if (data == 1) {
                            $('#name').css('color', 'red').html('用户名已注册');
                            $('.form-item-account').addClass('error');
                        } else if (data == 2) {
                            $('#name').css('color', 'green').html('用户名可以注册');
                            $('.form-item-account').addClass('succ');
                            $('#img').attr('src','/home/images/123.png')
                            $('#img').show();
                        } else if (data == 3) {
                            $('#name').css('color', 'red').html('长度只能在6-12个字符之间');
                            $('.form-item-account').addClass('error');
                        }
                    // alert(data);
                });
            });
            //判断密码
            $("input[name='password']").on('blur',function(){
                if($(this).val() == ''){
                    return false;
                }
                $.ajaxSetup({
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    }
                });
                $.get('/home/reg/ajaxp',{'password':$("input[name='password']").val()},function(data){
                    // console.log(data);
                    // console.log(typeof(data));
                    if(data == 1)
                    {
                        $('#pass').css('color','orange').html('安全强度适中');
//                        $('#form-pass').css('border', '1px solid green');
                        $('#img1').attr('src','/home/images/123.png');
                        $('#form-pass').css('border', '1px solid green').addClass('succ');
                        $('#img1').show();
                    }else if(data == 2)
                    {
                        $('#pass').css('color','red').html('密码必须是6-12位数字字母下划线!');
                        $('#form-pass').css('border', '1px solid red');
                        $('#img1').hide();
                    }

                    // alert(data);
                });
            });
            //判断第二次密码
            $("input[name='repassword']").on('blur',function(){
                if($(this).val() == ''){
                    return false;
                }
                $.get('/home/reg/ajaxrp',{'password':$("input[name='password']").val(),
                    'repassword':$("input[name='repassword']").val()},function(data){
                    if(data == 1)
                    {
                        $('#repass').hide();
                        $('#img2').attr('src','/home/images/123.png')
                        $('#img2').show();
                        $('#form-repass').css('border', '1px solid green').addClass('succ');
                    }else if(data == 2)
                    {
                        $('#repass').css('color','red').html('两次密码输入不一致,请从新输入!');
                        $('#repass').show();
                        $('#img2').hide();
                    }else if(data == 3)
                    {
                        $('#repass').css('color','red').html('密码不能为空!');
                        $('#repass').show();
                        $('#img2').hide();
                    }else if(data == 4)
                    {
                        $('#form-repass').css('border', '1px solid red').addClass('succ');
                        $('#repass').css('color','red').html('密码不合法!');
                        $('#repass').show();
                        $('#img2').hide();

                    }
                });
            });
            //判断邮箱
            $("input[name='email']").on('blur',function(){
                if($(this).val() == ''){
                    $('#name').css('color', 'white').html('');
                    $('#form-email').removeClass('error');
                    $('#form-email').removeClass('succ');
                    $('#img3').hide();
                    $('#email').html('');
                    return false;
                }
                $.ajaxSetup({
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    }
                });
                $.get('/home/reg/email',{'email':$("input[name='email']").val()},function(data){
                    $('#img3').hide();
                    $('#email').html('');
                    if(data == 1)
                    {
                        $('#img3').attr('src','/home/images/123.png');
                        $('#img3').show();
                        $('#form-email').addClass('succ');
                    }else if(data == 2) {
                        $('#form-email').addClass('error');
                        $('#email').css('color', 'red').html('格式错误');
                    }
                });
            });
        </script>
            <div class="reg-other">
            <div class="phone-fast-reg"><img src="{{asset('/home/images/phone.jpg')}}">
            </div>
            <div class="company-reg">

                    <i class="i-company"></i>
                    <span>企业用户注册</span>

            </div>
            <div class="inter-cust">

                    <i class="i-global"></i>
                    <span>INTERNATIONAL<br>CUSTOMERS</span>

            </div>
        </div>
    </div>
</div>
<div class="footer w">
    <div class="links">
        <a rel="nofollow" target="_blank" href="https://www.jd.com/intro/about.aspx"> 关于我们</a>|
        <a rel="nofollow" target="_blank" href="https://www.jd.com/contact/">联系我们</a>|
        <a rel="nofollow" target="_blank" href="https://zhaopin.jd.com/">人才招聘</a>|
        <a rel="nofollow" target="_blank" href="https://www.jd.com/contact/joinin.aspx">商家入驻</a>|
        <a rel="nofollow" target="_blank" href="https://www.jd.com/intro/service.aspx">广告服务</a>|
        <a rel="nofollow" target="_blank" href="https://app.jd.com/">手机京东</a>|
        <a target="_blank" href="https://club.jd.com/links.aspx">友情链接</a>|
        <a target="_blank" href="https://media.jd.com/">销售联盟</a>|
        <a href="https://club.jd.com/" target="_blank">京东社区</a>|
        <a href="https://gongyi.jd.com/" target="_blank">京东公益</a>|
        <a target="_blank" href="https://en.jd.com/" clstag="pageclick|keycount|20150112ABD|9">English Site</a>
    </div>
    <div class="copyright">
        Copyright&#169;2004-2016&nbsp;&nbsp;京东JD.com&nbsp;版权所有
    </div>
</div>
{{--<script type="text/javascript" src="./js/JD_files/a.js"></script>--}}

{{--<script type="text/javascript">--}}
    {{--var localmisc = $("#localmisc");--}}
    {{--if(1==localmisc.val()){--}}
        {{--seajs.use('../misc2016/js/localRegister', function (reg) {--}}
            {{--reg.init();--}}
        {{--})--}}
    {{--}else{--}}
        {{--seajs.use('../misc2016/js/register', function (reg) {--}}
            {{--reg.init();--}}
        {{--})--}}
    {{--}--}}
{{--</script>--}}
{{--<script src="./fp.htm"></script><script src="/y.htm"></script>--}}
{{--<script src="./js/md5.js"></script>--}}
{{--<script src="./js/f.js"></script>--}}
{{--<script type="text/javascript">--}}
    {{--$(function () {--}}
        {{--getJdEid(function (eid, fpid) {--}}
            {{--$("#eid").val(eid);--}}
            {{--$("#sessionId").val(fpid);--}}
        {{--});--}}
    {{--});--}}
{{--</script>--}}
<a target="_blank" href="https://surveys.jd.com/index.php?r=survey/index/sid/447941/lang/zh-Hans" class="feedback" style="margin-top: -85px; position: fixed; right: 0px; bottom: 50%;"></a>
</body>
</html>